package com.jy.rhin.support.parsing.enums;

import lombok.Getter;

/**
 * @Description: 传染病报告文档体部分
 * @Author: lww
 * @Date: 2022/6/21 9:44
 */
@Getter
public enum ReportElementEnum {

    /**
     * 文档体-症状章节部分
     */
    SYMPTOM("11450-4", null, "symptom.2", "component"),
    SYMPTOM_FIRST_DATE("DE04.01.005.00", "11450-4", "symptomFirstDate.4", "entry"),
    /**
     * 文档体-诊断记录部分
     */
    DIAGNOSIS_RECORD("29548-5", null, "diagnosisRecord.2", "component"),
    DIAGNOSIS_RECORD_MORBIDITY("DE05.10.015.00", "29548-5", "diagnosisRecordMorbidity.4", "entry"),
    DIAGNOSIS_RECORD_STATUS("DE05.01.060.00", "29548-5", "diagnosisRecordStatus.4", "entry"),
    DIAGNOSIS_RECORD_DATE("DE02.01.035.00", "29548-5", "diagnosisRecordDate.4", "entry"),
    DIAGNOSIS_RECORD_CATEGORY("DE05.01.016.00", "29548-5", "diagnosisRecordCategory.4", "entry"),
    DIAGNOSIS_RECORD_NAME("DE05.01.012.00", "29548-5", "diagnosisRecordName.4", "entry"),
    DIAGNOSIS_RECORD_OTHER_STATUTORY("DE09.00.041.00", "29548-5", "diagnosisRecordOtherStatutory.4", "entry"),
    DIAGNOSIS_RECORD_CORRECTION_DISEASE("DE05.01.013.00", "29548-5", "diagnosisRecordCorrectionDisease.4", "entry"),
    /**
     * 文档体-传染病死亡日期部分
     */
    DATE_DEATH("29548-4", null, "dateDeath.2", "component"),
    DATE_DEATH_ENTRY("DE02.01.035.00", "29548-4", "dateDeathEntry.4", "entry"),
    /**
     * 文档体-行政管理部分
     */
    ADMINISTRATIVE("29548-3", null, "administrative.2", "component"),
    ADMINISTRATIVE_REPORT_CARD("DE01.00.002.00", "29548-3", "administrativeReportCard.4", "entry"),
    ADMINISTRATIVE_ATTRIBUTION("DE02.01.006.00", "29548-3", "administrativeAttribution.4", "entry"),
    ADMINISTRATIVE_CARD_REASON("DE09.00.055.00", "29548-3", "administrativeCardReason.4", "entry"),
    ;

    private String code;
    private String parentCode;
    private String name;
    private String type;

    private ReportElementEnum(String code, String parentCode, String name, String type) {
        this.code = code;
        this.parentCode = parentCode;
        this.name = name;
        this.type = type;
    }

    public static ReportElementEnum lookup(String name) {
        if (name == null || "".equals(name)) {
            return null;
        }
        for (ReportElementEnum value : values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }

}
